| Conditions | 5 |
| Total Lines | 19 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import { Type } from '../HumanResource/Leave/LeaveRequest.entity'; |
||
| 38 | |||
| 39 | public getNumberOfMealTickets(itemsByDate: any[]): number { |
||
| 40 | let mealTicket = 0; |
||
| 41 | |||
| 42 | for (const sortedEvent of itemsByDate) { |
||
| 43 | let totalPerDay = 0; |
||
| 44 | |||
| 45 | for (const { time, type } of sortedEvent) { |
||
| 46 | if (type !== EventType.OTHER && 'leave' !== type) { |
||
| 47 | totalPerDay += time; |
||
| 48 | } |
||
| 49 | } |
||
| 50 | |||
| 51 | if (totalPerDay > 0.5) { |
||
| 52 | mealTicket++; |
||
| 53 | } |
||
| 54 | } |
||
| 55 | |||
| 56 | return mealTicket; |
||
| 57 | } |
||
| 59 |